<p:dialog xmlns="http://www.w3.org/1999/xhtml"
      	  xmlns:h="http://java.sun.com/jsf/html"
      	  xmlns:f="http://java.sun.com/jsf/core"
      	  xmlns:ui="http://java.sun.com/jsf/facelets"
      	  xmlns:p="http://primefaces.org/ui"
      	  modal="true"  resizable="true" 
		  widgetVar="dialogConsultarPlano" id="idDialogConsultarPlano" closable="true"
		  appendToBody="true" header="Consultar Plano"> 	
  	
	 <link rel="stylesheet" type="text/css" href="./estilos.css"/>  
<h:form id="formDialogConsultarPlano" >
<h:panelGroup id="pgDialogConsultarPlano">

 	<p:messages id="messagesPlano" autoUpdate="true" closable="true" /> 
    	<h:panelGrid columns="2" style="margin-right:10%;">  
            <h:outputLabel value="Código" styleClass="outputLabel"/>  
            <h:outputLabel value="Plano" styleClass="outputLabel"/>             
            <p:inputText value="#{planoBean.plano.idPlano}" styleClass="inputId"/>  
  			<p:inputText value="#{planoBean.plano.descricao}" styleClass="inputDescricao"/>  
        </h:panelGrid>  

    <p:commandButton value="Consultar" actionListener="#{matriculaBean.findPlano}" update="dataTablePlano" styleClass="commandButton" /> 
	<p:commandButton value="Novo"  process="@this pgDialogConsultarPlano" styleClass="commandButton" /> 
	<p:commandButton value="Limpar"   styleClass="commandButton" />
    		
    <p:dataTable id="dataTablePlano" var="plano" value="#{matriculaBean.findPlano()}"  
    			 rowKey="#{plano.idPlano}"  selectionMode="single" style="padding-top:20px;">  
        <f:facet name="header">Lista de Planos</f:facet>    
		<p:column style="text-align:center; float:center">  
            <f:facet name="header">  
                <h:outputText value="Código" />  
            </f:facet>  
            <h:outputText value="#{plano.idPlano}" />  
        </p:column>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Descrição" />  
            </f:facet>  
            <h:outputText value="#{plano.descricao}" />  
        </p:column>  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Período" />  
            </f:facet>  
            <h:outputText value="#{plano.periodo.descricao}" />  
        </p:column> 
        <p:column style="text-align:center; float:center">  
            <f:facet name="header">  
                <h:outputText value="Condição de Pagamento" />  
            </f:facet>  
            <h:outputText value="#{plano.condicaoPagamento.descricao}" />  
        </p:column> 
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Valor" />  
            </f:facet>  
            <h:outputText value=" R$ #{plano.total}" />  
        </p:column> 
        <p:column style="width:4%; text-align:center; float:center">  
        	<f:facet name="header">
        	 <h:outputText value="Adicionar" />
        	</f:facet>
         	<p:commandButton id="selectButtonEditar" actionListener="#{matriculaBean.selectPlano}" process="@this"  icon="ui-icon-circle-plus" title="Detail" />
        </p:column> 
    </p:dataTable> 

 </h:panelGroup>
 </h:form>
</p:dialog>
